package com.synjones.zeus.model.web;

import com.synjones.zeus.model.ykt.pay.PayType;

/**
 * 终端类型
 * Created by liubinqiang on 2018/4/27.
 */
public enum TerminalType {

    _1("1", "立式定额"),
    _2("2", "台式定额"),
    _3("3", "挂式定额"),

    _5("5", "立式非定额"),
    _6("6", "台式非定额"),
    _7("7", "挂式非定额"),

    _4("4", "其它");

    private final String code;// 状态码
    private final String desc;// 状态码描述

    TerminalType(String code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public String code() {
        return code;
    }

    public String desc() {
        return desc;
    }

    /**
     * *
     * 根据code获取描述
     *
     * @param code
     * @return
     */
    public static String getDesc(String code) {
        for (TerminalType info : TerminalType.values()) {
            if (info.code.equals(code)) {
                return info.desc;
            }
        }
        return null;
    }

}
